﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Reflection;

namespace Plugin
{
    public abstract class BaseAttribute : Attribute
    {
        string _name;

        public string Name
        {
            get { return _name; }
        }

        string _iconName;

        public string IconName
        {
            get { return _iconName; }
        }

        Image _image;

        public Image Image
        {
            get { return _image; }
            set { _image = value; }
        }

        public BaseAttribute(string name, string iconName)
        {
            _name = name;
            _iconName = iconName;

            Assembly asm = Assembly.GetAssembly(typeof(BaseAttribute));

            Image = Image.FromStream(asm.GetManifestResourceStream(_iconName));
        }
    }

    [AttributeUsage(AttributeTargets.Class)]
    public class ClassAttribute : BaseAttribute
    {
        public ClassAttribute(string name, string iconName)
            : base(name, iconName)
        {
        }
    }

    [AttributeUsage(AttributeTargets.Event)]
    public class EventAttribute : BaseAttribute
    {
        public EventAttribute(string name, string icon)
            : base(name, icon)
        {
        }
    }

    [AttributeUsage(AttributeTargets.Method)]
    public class MethodAttribute : BaseAttribute
    {
        public MethodAttribute(string name, string iconName)
            : base(name, iconName)
        {
        }
    }

    [AttributeUsage(AttributeTargets.Field)]
    public class FieldAttribute : BaseAttribute
    {
        public FieldAttribute(string name, string iconName)
            : base(name, iconName)
        {
        }
    }
}
